/**
 *
 */
package de.cbf.cam.dsa.rcp.model.entities;

import java.util.ArrayList;
import java.util.List;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;

/**
 * @author salter
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
public class NameList {
//	@XmlElementWrapper(name="names")
	@XmlElement(name="name")
	protected List<String> names;

	public NameList() {
		super();
		names = new ArrayList<String>();
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((names == null) ? 0 : names.hashCode());
		return result;
	}




	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		NameList other = (NameList) obj;
		if (names == null) {
			if (other.names != null)
				return false;
		} else if (!names.equals(other.names))
			return false;
		return true;
	}



	public void addNames(List<String> newNames){
		names.addAll(newNames);
	}

	public List<String> getNames() {
		return names;
	}

	public void setNames(List<String> names) {
		this.names = names;
	}






}
